home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume6 / xpwdoc / part01 next >
Encoding:
Internet Message Format  |  1990-04-11  |  77.9 KB

  1. Path: uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!sun-barr!newstop!sun!NSFnet-Relay.AC.UK
  2. From: jonm%syma.sussex.ac.uk@NSFnet-Relay.AC.UK (Jonathan Meyer)
  3. Newsgroups: comp.sources.x
  4. Subject: v06i065: Xpw Documentation, Part01/02
  5. Message-ID: <134353@sun.Eng.Sun.COM>
  6. Date: 12 Apr 90 07:36:14 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1853
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: Jonathan Meyer <jonm%syma.sussex.ac.uk@NSFnet-Relay.AC.UK>
  12. Posting-number: Volume 6, Issue 65
  13. Archive-name: xpwdoc/part01
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 1 (of 2)."
  22. # Contents:  doc doc/help/PopComposite doc/help/PopCore
  23. #   doc/help/PopGraphic doc/help/PopPixmap doc/help/PopScrollText
  24. #   doc/help/PopWidgets doc/help/PopWidgets.news doc/ref/PopComposite
  25. #   doc/ref/PopCore doc/ref/PopGraphic doc/ref/PopPixmap
  26. # Wrapped by jonm@csunb on Wed Apr  4 16:16:14 1990
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test ! -d 'doc' ; then
  29.     echo shar: Creating directory \"'doc'\"
  30.     mkdir 'doc'
  31. fi
  32. if test -f 'doc/help/PopComposite' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'doc/help/PopComposite'\"
  34. else
  35. echo shar: Extracting \"'doc/help/PopComposite'\" \(1809 characters\)
  36. sed "s/^X//" >'doc/help/PopComposite' <<'END_OF_FILE'
  37. XHELP *PopComposite                Jonathan Meyer, Jan 1990
  38. X
  39. XPoplog Widget Set, revision 3.
  40. X
  41. XThis file describes the Pop-11 interface to the PopComposite widget
  42. Xclass. For details of the PopComposite widget, see REF *PopComposite.
  43. XFor information on other widgets in the Poplog Widget Set, see HELP
  44. X*PopWidgets.
  45. X
  46. X
  47. XContents
  48. X
  49. X-- Introduction -------------------------------------------------------
  50. X
  51. X
  52. XComposite widgets are used to as containers for other widgets. Each
  53. Xcomposite widget has a list of children (called the managed set),
  54. Xand has procedures for adding or removing widgets from this set
  55. X(managing or unmanaging widgets). Composite widgets with different
  56. Xpolicies for determining the geomoetry of their children are used
  57. Xto make list widgets, vpaned widgets, etc. A key part of the
  58. XComposite widget is its Resize procedure, which is used to
  59. Xrecalculate the geometry of the children widgets when the composite
  60. Xwidget is resized. Composite widgets can contain further composite
  61. Xwidgets, allowing for different layout schemes within the same
  62. Xwindow.
  63. X
  64. XThis file descibes how to load and use the PopComposite widget class,
  65. Xwhich is a direct descendant of the Composite widget class that is
  66. Xprovided in the Xt intrinsics. The PopComposite widget adds a callback
  67. Xlist to the structure of the Composite widget. The callback is used to
  68. Xnotify clients of resize events, and when the managed set of children of
  69. Xthe composite widget is changed.
  70. X
  71. XOther documentation is available to describe Composite widgets in detail
  72. X(see below).
  73. X
  74. X-- Loading the PopComposite Widget ------------------------------------
  75. X
  76. XTo load the PopComposite widget class, either use
  77. X
  78. X    LIB *PopComposite - loads only the PopComposite widget
  79. Xor
  80. X    LIB *PopWidgets - loads all of the Poplog Widgets.
  81. X
  82. X
  83. X
  84. X
  85. XRelated Documentation
  86. X
  87. XXtIntrinsics Programmers Guide
  88. END_OF_FILE
  89. if test 1809 -ne `wc -c <'doc/help/PopComposite'`; then
  90.     echo shar: \"'doc/help/PopComposite'\" unpacked with wrong size!
  91. fi
  92. # end of 'doc/help/PopComposite'
  93. fi
  94. if test -f 'doc/help/PopCore' -a "${1}" != "-c" ; then 
  95.   echo shar: Will not clobber existing file \"'doc/help/PopCore'\"
  96. else
  97. echo shar: Extracting \"'doc/help/PopCore'\" \(6481 characters\)
  98. sed "s/^X//" >'doc/help/PopCore' <<'END_OF_FILE'
  99. XHELP *PopCore                                   Jonathan Meyer, Jan 1990
  100. X
  101. XPoplog Widget Set, revision 3.
  102. X
  103. XThis file describes the Pop-11 interface to the PopCore
  104. Xwidget class, which is part of the
  105. XPoplog Widget Set. For details of other widgets in the Poplog Widget
  106. XSet, see HELP *PopWidgets. For more details of the PopCore
  107. Xwidget class, see REF *PopCore.
  108. X
  109. X
  110. X         CONTENTS - (Use <ENTER> g to access required sections)
  111. X
  112. X -- PopCore Widget
  113. X -- PopCore Resources
  114. X -- Resource Notes
  115. X -- Further Notes
  116. X -- Actions
  117. X -- Translations
  118. X -- Methods
  119. X
  120. X-- PopCore Widget -----------------------------------------------------
  121. X
  122. XThe PopCore widget is similar to the Core widget class but with  more
  123. Xresources, and a callback list that is activated through an action. You
  124. Xcan specify the events that the callback is activated on using the
  125. Xtranslation table. The PopCore widget has a Graphics Context, which is
  126. Xused to hold resources like line width, line style, foreground and
  127. Xbackground colours etc. This graphics context is used by subclasses of the
  128. XPopCore widget class in graphics and text operations.
  129. X
  130. XThe PopCore widget class is intended as a base for building more
  131. Xsophisticated widget classes. As such, it is probably of limited use to
  132. Xapplications, which will probably use subclasses of PopCore, such as the
  133. XPopGraphic widget class.
  134. X
  135. X-- PopCore resources --------------------------------------------------
  136. X
  137. Xxt_value(<widget>,XtNautoFlush) -> <boolean>
  138. X<boolean> ->  xt_value(<widget>,XtNautoFlush)
  139. X    Auto flushing occurs after you have performed some action (method)
  140. X    on widgets which are subclasses of PopCore. An auto flush works
  141. X    simply by calling XFlush with the relevant arguments. By disabling
  142. X    auto flushing, you can perform multiple operations without having to
  143. X    wait for the X Server to respond. When you have finished the
  144. X    operations, reset auto flusing to on, and the operations will be
  145. X    processed in one batch. This can be much more efficient than waiting
  146. X    for each action to be processed. For example:
  147. X
  148. X    false -> xt_value(w, XtNautoFlush);
  149. X    repeat 100 times
  150. X         XpwDrawPoint(w, random(100),random(100));
  151. X         /* draw 100 points and then flush the buffer */
  152. X    endrepeat;
  153. X    true -> xt_value(w, XtNautoFlush);
  154. X
  155. Xxt_value(<widget>,XtNpointerShape) -> shape
  156. Xshape -> xt_value(<widget>,XtNpointerShape)
  157. X    Changing the pointerShape resource affects the cursor that is used
  158. X    when the mouse pointer is within the widgets window. See
  159. X    XpwSetCursor below for an easier method of setting standard cursors.
  160. X
  161. X
  162. X-- Methods ---------------------------------------------------------------
  163. X
  164. XFor more information about Poplog Widget Methods, see REF
  165. X*XpwCallMethod and REF *XpwMethods.
  166. X
  167. XPopCore widgets respond to six methods: XpwSetColor, XpwFreeColor,
  168. XXpwSetFont, XpwFreeFont, XpwSetCursor and XpwFreeCursor. These methods
  169. Xemploy caches so that the application can repeatedly change colors, fonts
  170. Xand cursors without expensive calls to the X Server.
  171. X
  172. XXpwSetColor(<widget>, <name:string>);
  173. X    This method is used to set the foreground of a widget to the named color.
  174. X    It works as follows: if the color cache has not yet been initialized,
  175. X    a new cache is created, with two entries - XtDefaultForeground and
  176. X    XtDefaultBackground. The first entry is used if the name string is NULL.
  177. X    If the name string isn't null, it is converted into a lowercase quark, and
  178. X    the cache is searched for an entry whose key is that quark. If an entry
  179. X    does not exist, and a call to XParseColor/XAllocColor is successful, the
  180. X    returned color is added to the cache. If both attempts to locate the color
  181. X    fail, the method returns with a result of zero. Otherwise, the method uses
  182. X    XtSetValues to set the foreground of the widget, and returns with the
  183. X    new color's pixel value.
  184. X
  185. XXpwFreeColor(<widget>, <name:string>);
  186. X    FreeColor will search the color cache for the named color. If
  187. X    an entry in the cache exists, the related XColor is released using
  188. X    XFreeColor, and the cache entry is removed. You cannot free the XtDefault
  189. X    cache entries -they are always available to XpwSetColor calls. If you free
  190. X    a color which is the current foreground of the widget, the method calls
  191. X    XpwSetColor to set the foreground of the widget to the default foreground.
  192. X
  193. XXpwSetFont(<widget>, <fontname:string>);
  194. X    This method works as follows: if the font cache has not yet been
  195. X    initialized, a new cache is created, with one entry - XtDefaultFont.
  196. X    This entry is used if the fontname string is NULL. If the fontname string
  197. X    isn't null, it is converted into a lowercase quark, and the cache is
  198. X    searched for an entry whose key is that quark. If an entry does not exist,
  199. X    and a call to XLoadQueryFont is successful, the returned font is added to
  200. X    the cache. If both attempts to locate the font fail, the method returns
  201. X    with a result of zero. Otherwise, the method uses XtSetValues to set the
  202. X    font of the widget, and the method returns with the font's ID.
  203. X
  204. XXpwFreeFont(<widget>, <fontname:string>);
  205. X    FreeFont will search the font cache for a font whose name is fontname.
  206. X    If an entry in the cache exists, the related XFontStruct is released using
  207. X    XFreeFont, and the cache entry is removed. You cannot free the XtDefaultFont
  208. X    cache entry - this font is always available to XpwSetFont calls. If you
  209. X    free a font which is the current font for the widget, the method calls
  210. X    XpwSetFont to set the font of the widget to the default font.
  211. X
  212. XXpwSetCursor(<widget>, <shape:integer>);
  213. X    XpwSetCursor first checks to see if the cursor cache exists. If it does
  214. X    not exist, a new cache is created, with no entries. Otherwise the cache
  215. X    is searched for the requested cursor shape (XC_crosshair, XC_arrow etc).
  216. X    If an entry in the cache does not exist, the method calls XCreateFontCursor
  217. X    to load the requested cursor shape, which is then added to the cache.
  218. X    Then the method uses XtSetValues to set the pointerShape resource of the
  219. X    widget. The cursor returned from XCreateFontCursor is returned.
  220. X
  221. XXpwFreeCursor(<widget>, <shape:integer>);
  222. X    This method first checks the cursor cache for an entry corrosponding to
  223. X    shape. If that entry exists, PopFreeCursor uses XFreeCursor to release the
  224. X    memory associated with the cursor. If the current cursor for the widget is
  225. X    the same as shape, XtSetValues is used to set the cursor to the server
  226. X    default (ie. using XUndefineCursor).
  227. END_OF_FILE
  228. if test 6481 -ne `wc -c <'doc/help/PopCore'`; then
  229.     echo shar: \"'doc/help/PopCore'\" unpacked with wrong size!
  230. fi
  231. # end of 'doc/help/PopCore'
  232. fi
  233. if test -f 'doc/help/PopGraphic' -a "${1}" != "-c" ; then 
  234.   echo shar: Will not clobber existing file \"'doc/help/PopGraphic'\"
  235. else
  236. echo shar: Extracting \"'doc/help/PopGraphic'\" \(6681 characters\)
  237. sed "s/^X//" >'doc/help/PopGraphic' <<'END_OF_FILE'
  238. XHELP PopGraphic                          Jonathan Meyer,  Mar 1990
  239. X
  240. XPoplog Widget Set, revision 3.
  241. X
  242. XThis file describes the Pop-11 interface to the PopGraphic widget class.
  243. XFor details of the PopGraphic widget class, see REF *PopGraphic. HELP
  244. X*PopWidgets outlines the Poplog Widget Set. See HELP *xt_graphic for
  245. Xdetails of a higher level interface is provided for users using LIB
  246. X*xt_graphic. PWM compatibility routines using this widget class are
  247. Xdescribed in HELP *xt_pwm
  248. X
  249. X
  250. X         CONTENTS - (Use <ENTER> g to access required sections)
  251. X
  252. X -- Introduction
  253. X -- Functions for drawing on the widget
  254. X -- Text functions
  255. X -- Image dumping functions
  256. X -- Window functions
  257. X -- Colormap operations
  258. X -- Functions that return (integer) values about the display
  259. X -- Functions that alter the Graphics Context
  260. X -- Draw Functions
  261. X -- Related Documentation
  262. X
  263. X-- Introduction -------------------------------------------------------
  264. X
  265. XLib PopGraphic loads the "Popgraphic" widget class (from the Poplog
  266. XWidget Set) and assigns the widget_class record created to the
  267. Xvariable -PopGraphic-. (See SHOWLIB *xt_load_wc, HELP *xt_core, HELP
  268. X*xt_widgets). This widget class creates widgets which are simple
  269. Xgraphics planes, on which you can draw lines, dump images, write text
  270. Xetc.. Lib PopGraphic also provides a number of routines for doing these
  271. Xthings, described below.
  272. X
  273. XA higher level interface to the PopGraphic widget is provided by
  274. Xroutines in LIB xt_graphics (see HELP *xt_graphic)
  275. X
  276. X
  277. X-- Functions for drawing on the widget --------------------------------
  278. X
  279. XXpwDrawPoint(<widget>, x, y)
  280. X    Draws a single point (x,y).
  281. X
  282. XXpwDrawPoints(<widget>, pts)
  283. X    Draws a single point (x,y).
  284. X
  285. XXpwDrawLine(<widget>, x1, y1, x2, y2)
  286. X    Draws a line between the points (x1,y1) and (x2, y2).
  287. X
  288. XXpwDrawRectangle(<widget>, x, y, width, height).
  289. X    Draws a rectangle top left corner x,y.
  290. X
  291. XXpwDrawArc(<widget>, x,y, width, height, start_angle, extent)
  292. X    Draws an arc, whose top left coord is x,y and of width*height
  293. X    size. The start_angle is measured from the three O'clock position,
  294. X    and the arc continues for extent degrees. start_angle and extent
  295. X    are measured in 64ths of a degree.
  296. X
  297. X
  298. X-- Text functions -----------------------------------------------------
  299. X
  300. XXpwWriteString(<widget>, x,y, <string>)
  301. X    Writes the string at the location (x,y).
  302. X
  303. X
  304. X-- Image dumping functions --------------------------------------------
  305. X
  306. XXpwPutImage(<widget>, xdim, ydim, x, y, <vecptr>)
  307. X    Copies an array onto the window. This is perhaps the most complex
  308. X    function. xdim and ydim are the x and y dimensions of the array. x
  309. X    and y are the coordinates where the top left corner of the array
  310. X    should appear. <vecptr> is the arrayvector of the array. Notice
  311. X    that the array should be the correct format for the display-
  312. X    monochrome displays must use one bit deep arrays, with the xdim a
  313. X    multiple of eight. Color displays can cope with any dimensions,
  314. X    but notice that the colormap will probably have to be set
  315. X    properly.
  316. X
  317. X    A typical call might be:
  318. X        XpwPutImage(w, 512, 512, 10,10, arrayvector(pic1));
  319. X
  320. X
  321. X-- Window functions ---------------------------------------------------
  322. X
  323. XXpwClearWindow(<widget>)
  324. X    Clears the window associated with <widget>
  325. X
  326. XXpwRestoreWindow(<widget>)
  327. X    Refreshes the contents of the window.
  328. X
  329. X-- Colormap operations ------------------------------------------------
  330. X
  331. XXpwAllocColorRange(<widget>,num_cells, r1,g1,b1,r2,g2,b2) -> pixelvalue
  332. X    Allocates a new colour range in the colormap, with the (integer
  333. X    0-255) RGB values specified as the start and end colours for the
  334. X    range, and with num_cells of the colormap allocated. Returns a pixel
  335. X    value which indicates where in the colormap the set of colors start
  336. X
  337. XXpwAllocColor(<widget>r1,g1,b1) -> pixelvalue
  338. X    As for XpwAllocColorRange, but only for one color.
  339. X
  340. XXpwSetPixel(<widget>,pixel,red,green,blue)
  341. X    Changes the color entry in the colormap for the pixel to the
  342. X    specified RGB.
  343. X
  344. XXpwSetColor(<widget>,<string:name>)
  345. X    Sets the foreground colour of the widget to the named colour, which
  346. X    is retrieved from the colour database. See HELP *XpwPopMethods
  347. X
  348. XXpwSwitchColormaps(<widget>) -> <boolean>;
  349. X<boolean> -> XpwSwitchColormaps(<widget>);
  350. X    If set to true, the widget will perform its own colormap switching. This
  351. X    is useful if the window manager does not perform colormap switching. The
  352. X    default value is false. Colormaps should be switched when the mouse
  353. X    enters the window.
  354. X
  355. X-- Functions that return (integer) values about the display -----------
  356. X
  357. XXpwWidth(<widget>,1,false)
  358. X    Returns the width of the window of the widget.
  359. X
  360. XXpwHeight(<widget>,1,false)
  361. X    Returns the height of the window of the widget.
  362. X
  363. XXpwDepth(<widget>,1,false)
  364. X    Returns the depth (num of planes) of the window of the widget.
  365. X
  366. XXpwScreenWidth(<widget>,1,false)
  367. X    Returns the width of the screen in pixels.
  368. X
  369. XXpwScreenHeight(<widget>,1,false)
  370. X    Returns the height of the screen in pixels.
  371. X
  372. X-- Functions that alter the Graphics Context --------------------------
  373. X
  374. X
  375. XThe graphics context contains information about the line style, the
  376. Xforeground and background colours, the current font and the drawing mode
  377. Xthat is used. These values can be set using xt_value, specifying the 
  378. Xresource as named in REF *PopGraphic. The following functions are 
  379. Xprovided as a convenience:
  380. X
  381. XXpwLineWidth(<widget>) -> <integer>
  382. X<integer> -> XpwLineWidth(<widget>)
  383. X    Changes or returns the width of lines drawn on the window associated
  384. X    with the widget.
  385. X
  386. XXpwDrawFunction(<widget>) -> <integer>
  387. X<integer> -> XpwDrawFunction(<widget>)
  388. X    Changes or returns the drawing function used. <integer> here is a
  389. X    valid X draw function, as described in 'Draw Functions' below.
  390. X
  391. XXpwForeground(<widget>) -> <integer>
  392. X<integer> -> XpwForeground(<widget>)
  393. X    Changes the foreground color of the widget to the specified pixel
  394. X    colour.
  395. X
  396. XXpwBackground(<widget>) -> integer
  397. X<integer> -> XpwBackground(widget)
  398. X    Same as foreground
  399. X
  400. XXpwSetFont(<widget>,string) -> <boolean>
  401. X    Changes the current font. Returns <true> if it succeeds, and <false>
  402. X    if it fails.
  403. X
  404. X
  405. X-- Draw Functions -----------------------------------------------------
  406. X
  407. XLib PopGraphic defines constants for all the X windows draw
  408. Xfunctions (as used by -XpwDrawFunction- above) as follows:
  409. X
  410. X    GXclear
  411. X    GXand
  412. X    GXandReverse
  413. X    GXcopy
  414. X    GXandInverted
  415. X    GXnoop
  416. X    GXxor
  417. X    GXor
  418. X    GXnor
  419. X    GXequiv
  420. X    GXinvert
  421. X    GXorReverse
  422. X    GXcopyInverted
  423. X    GXorInverted
  424. X    GXnand
  425. X    GXset
  426. X
  427. X
  428. X-- Related Documentation ----------------------------------------------
  429. X
  430. XHELP *xt_graphic  - for a higher level POP11  interface,
  431. XHELP *xt_pwm      - PWM compatibility routines
  432. X
  433. END_OF_FILE
  434. if test 6681 -ne `wc -c <'doc/help/PopGraphic'`; then
  435.     echo shar: \"'doc/help/PopGraphic'\" unpacked with wrong size!
  436. fi
  437. # end of 'doc/help/PopGraphic'
  438. fi
  439. if test -f 'doc/help/PopPixmap' -a "${1}" != "-c" ; then 
  440.   echo shar: Will not clobber existing file \"'doc/help/PopPixmap'\"
  441. else
  442. echo shar: Extracting \"'doc/help/PopPixmap'\" \(301 characters\)
  443. sed "s/^X//" >'doc/help/PopPixmap' <<'END_OF_FILE'
  444. XHELP PopPixmap                      Jonathan Meyer,  Mar 1990
  445. X
  446. XPoplog Widget Set, revision 3.
  447. X
  448. XThe PopPixmap widget is a member of the Poplog Widget Set. For more
  449. Xinformation see HELP *PopWidgets, and REF *PopPixmap. For information on
  450. Xthe Pop-11 interface to PopPixmap widgets, see HELP *PopGraphic.
  451. END_OF_FILE
  452. if test 301 -ne `wc -c <'doc/help/PopPixmap'`; then
  453.     echo shar: \"'doc/help/PopPixmap'\" unpacked with wrong size!
  454. fi
  455. # end of 'doc/help/PopPixmap'
  456. fi
  457. if test -f 'doc/help/PopScrollText' -a "${1}" != "-c" ; then 
  458.   echo shar: Will not clobber existing file \"'doc/help/PopScrollText'\"
  459. else
  460. echo shar: Extracting \"'doc/help/PopScrollText'\" \(5401 characters\)
  461. sed "s/^X//" >'doc/help/PopScrollText' <<'END_OF_FILE'
  462. XHELP *PopScrollText    DRAFT - INCOMPLETE            Jonathan Meyer, Jan 1990
  463. X
  464. XPoplog Widget Set, revision 3.
  465. X
  466. XThis file describes the Pop-11 interface to the PopScrollText widget
  467. Xclass. For details of the PopScrollText widget, see REF *PopScrollText.
  468. XFor information on other widgets in the Poplog Widget Set, see HELP
  469. X*PopWidgets.
  470. X
  471. X
  472. X         CONTENTS - (Use <ENTER> g to access required sections)
  473. X
  474. X -- Introduction
  475. X -- Procedures for PopScrollText Widgets
  476. X -- Resource Access
  477. X
  478. X
  479. X-- Introduction -------------------------------------------------------
  480. X
  481. X
  482. XThe PopScrollText widget was primarliy designed to simplify the transfer
  483. Xof VED to X windows. The widget understands a number of basic text
  484. Xoperations, which it translates into Xlib calls to manipulate the
  485. Xcontents of a window. Operations include scrolling text, displaying
  486. Xtext, getting input, and processing events.
  487. X
  488. XThe PopScrollText widget has very specific low level functionality, and
  489. Xmost applications will probably use higher level Text widgets, such as
  490. Xthe one described in HELP *PopText.
  491. X
  492. X-- Loading the PopScrollText Widget -----------------------------------
  493. X
  494. XThe Pop-11 interface to the PopScrollText is called LIB *PopScrollText.
  495. XThis library does several things:
  496. X
  497. X1) loads the PopScrollText and PopCore widget classes, if necessary.
  498. X
  499. X2) loads the external procedure XpwPopCallMethod, for accessing methods
  500. X   understood by the PopScrollText widget.
  501. X
  502. X3) defines a set of procedures, written using XpwPopCallMethod and
  503. X   XpwSetValues, to provide an error-checking interface to the widget.
  504. X
  505. XThis document concentrates on the Pop-11 procedures defined in (3).
  506. X
  507. X-- Procedures for PopScrollText Widgets -------------------------------
  508. X
  509. XThe following procedures are declared in LIB *PopScrollText:
  510. X
  511. XXpwTextClearLines(w,l1,l2);
  512. X    Clears the lines between l1 and l2 of PopScrollText widget w.
  513. X
  514. XXpwTextClearTail(w,r,c);
  515. XXpwTextClearTails(w, l1,l2,c);
  516. X    Clears all of the characters after column c of PopScrollText
  517. X    widget w. The second form clears the tails of lines between l1 and
  518. X    l2, whereas the first form clears the tail of the single line r.
  519. X
  520. XXpwTextScroll(w, l1, l2, dist);
  521. X    Moves the text between lines l1 and l2 by distance dist. Dist is
  522. X    a positive or negative integer, so to scroll the PopScrollText
  523. X    widget w up by one line, use:
  524. X        XpwTextScroll(w, 0, XpwTextNumLines(w), -1);
  525. X
  526. X
  527. XXpwTextMoveTail(w, r, c, dist);
  528. X    Moves the text on row r, after column c by distance dist for
  529. X    PopScrollText widget w. Distance is measured in characters, and
  530. X    can be positive or negative. To move a whole line left by one
  531. X    character, use:
  532. X        XpwTextMoveTail(w, line, 0, -1);
  533. X
  534. XXpwTextMoveTails(w,l1,l2,c, dist);
  535. X    Moves the text on lines between l1 and l2, after column c, by
  536. X    distance dist. Distance is measured in characters, and can 
  537. X    be positive or negative. To move all of the text in a window
  538. X    right by one character, for PopScrollText widget w, use:
  539. X        XpwTextMoveTails(w, 0, XpwTextNumLines(w), 0, 1);
  540. X
  541. XXpwTextInsert(w, r, c, string);
  542. X    Inserts the string at row r, column c of PopScrollText widget w.
  543. X    Text on that row and column will be moved right to make room for the
  544. X    string.
  545. X
  546. XXpwTextOverwrite(w, r, c, string);
  547. X    Draws the string on row r, column c of PopScrollText widget w.
  548. X    Text previously at that location will be overwritten.
  549. X
  550. XXpwTextOverwriteLines(w, start_line, strings);
  551. X    Takes a PopScrollText widget, an array of strings, and a
  552. X    start line. Overwrites the text on lines starting at start_line
  553. X    with strings in array. Any line with text drawn on it will be 
  554. X    cleared first. 
  555. X
  556. XXpwTextCursorTo(w, r, c);
  557. X    Moves the text cursor for the PopScrollText widget w to 
  558. X    row r, column c. 
  559. X
  560. XNOTE: Any of the above procedures can cause exposure events, if text
  561. Xthat was previously obscured by a window becomes visible after
  562. Xscrolling, or text insertion.
  563. X
  564. X
  565. X-- Resource Access ----------------------------------------------------
  566. X
  567. X
  568. XXpwSetFont(w, name) -> result;
  569. X    Takes a Poplog widget and a font name, and tries to load the
  570. X    font. If the XLoadFont is successful, the fonts ID is returned.
  571. X    Otherwise returns false. <name> can also be a font ID number,
  572. X    in which case XpwSetValues is used to set the font resource of
  573. X    the widget w.
  574. X
  575. X
  576. XXpwTextMargin(w) -> val;
  577. X    val -> XpwTextMargin(w);
  578. X    Sets or retreives the left hand margin of the text widget w.
  579. X    Default value for this margin is 2. If the margin is changed
  580. X    then the exposure callback is used to tell the application to
  581. X    redraw the text in the widget.
  582. X
  583. XXpwTextFontWidth(w) -> val;
  584. XXpwTextFontHeight(w) -> val;
  585. X    The font width and height are calculated in pixels from the 
  586. X    XFontStruct information held in the widgets 'font' resource.
  587. X    These two procedures return the size of the current font for
  588. X    PopScrollText widget w.
  589. X
  590. X
  591. XXpwTextNumRows(w)
  592. X    num -> XpwTextNumRows(w);
  593. X    Returns or sets the number of rows in the widget w. The updater
  594. X    form will cause a ResizeRequest to resize the widget. Resizing 
  595. X    the widget will cause an exposure event.
  596. X
  597. XXpwTextNumColumns(w)
  598. X    num -> XpwTextNumColumns(w);
  599. X    Returns or sets the number of columns in the PopScrollText 
  600. X    widget w. Resizes the widget if necessary.
  601. X
  602. XXpwTextExposedLines(w)
  603. X    Returns an array of short integers for the PopScrollText widget w.
  604. X    Each element of the array corrosponds to one line of text in w.
  605. X    The elements of the array are set according to which lines of
  606. X    text need refreshing after an exposure event. See REF *PopScrollText
  607. X    for more information.
  608. END_OF_FILE
  609. if test 5401 -ne `wc -c <'doc/help/PopScrollText'`; then
  610.     echo shar: \"'doc/help/PopScrollText'\" unpacked with wrong size!
  611. fi
  612. # end of 'doc/help/PopScrollText'
  613. fi
  614. if test -f 'doc/help/PopWidgets' -a "${1}" != "-c" ; then 
  615.   echo shar: Will not clobber existing file \"'doc/help/PopWidgets'\"
  616. else
  617. echo shar: Extracting \"'doc/help/PopWidgets'\" \(7446 characters\)
  618. sed "s/^X//" >'doc/help/PopWidgets' <<'END_OF_FILE'
  619. XHELP  POPWIDGETS                             Jonathan Meyer, Jan 1990
  620. X
  621. XPoplog Widget Set for X11, revision 3.
  622. X
  623. X
  624. XThis document provides an overview of the Poplog Widget Set. For more
  625. Xinformation on individual widgets, see the Related Documentation listed
  626. Xbelow.
  627. X
  628. X
  629. X         CONTENTS - (Use <ENTER> g to access required sections)
  630. X
  631. X -- Introduction
  632. X -- The Poplog Widget Tree
  633. X -- The PopCore Widgets
  634. X -- Loading Poplog Widget Set
  635. X -- Related Documentation
  636. X
  637. X
  638. X-- Introduction -------------------------------------------------------
  639. X
  640. XThe X Toolkit provides a C-based object orientated library. The library
  641. Xis based around two things:
  642. X
  643. X    1. The Intrinsics
  644. X    2. Widget Sets
  645. X
  646. X1. Intrinsics
  647. X
  648. XThese are a set of procedures for manipulating and controlling the
  649. Xtoolkit. They contain procedures to initialize the toolkit, create
  650. Xtoolkit objects (called widgets), control the widgets during their
  651. Xlifetime, and destroy them. Look at HELP * XTOOLKIT, HELP *XT_WIDGETS, 
  652. Xand the other helpfiles starting with XT in * XPOP_INDEX.
  653. X
  654. X2. Widget Sets
  655. X
  656. XWidgets are the graphics objects that are manipulated by the Toolkit.
  657. XThey each belong to a class, and have a set of properties. Widget
  658. Xproperties include resources, actions, translation tables, and a set of
  659. Xprocedures for performing other operations on the widget (such as
  660. Xresizing it, or destroying it). Typical widgets are text editors,
  661. Xscrollbars, buttons, menues etc. A Widget Set is a collection of widgets
  662. Xthat all have the same "look and feel" and similar programmer
  663. Xinterfaces. Widget Sets are available from the OSF (Motif), Sony,
  664. XHewlett Packard (Xw), Sun, AT&T and others. Currently only the Athena
  665. Xwidget set (Xaw) is officially part of the X11R3 release.
  666. X
  667. X-- The Poplog Widget Tree ---------------------------------------------
  668. X
  669. XThe Poplog Widget Set was designed to provide an interface between X
  670. XWindows and Poplog. It is written in C and externally loaded into Poplog.
  671. XIt contains two types of widgets: (1) the PopCore widget class and its 
  672. Xdescendants, and (2) a few additional widget classes which are subclasses 
  673. Xof Athena or X Toolkit widgets.
  674. X
  675. X1) The PopCore widget tree contains a number of widgets which are at a
  676. X"medium" level. They are at a higher level than the fundamental toolkit
  677. Xwidgets, or raw X Windows, but they are at a much lower level than
  678. Xwidgets like ScrollBar or AsciiString, since they are not designed for a
  679. Xspecific purpose. They have a large number of resources, which the user
  680. Xcan specify. Each widget responds to a set of methods, and uses
  681. Xcallbacks - a mechanism allowing the programmer to "trap" events that he
  682. Xis interested in. This interface is much easier to program than raw
  683. XXlib.
  684. X
  685. X2) There are currently two additional widget classes in the Poplog
  686. XWidget Set: PopComposite and PopText. These widgets inherit all of the
  687. Xbehaviour of their superclasses (Composite and AsciiString respectively)
  688. Xbut add additional callback actions. These callbacks are used to notify
  689. Xapplications of events such are the widget being resized, or a button
  690. Xbeing pressed. These widgets may not appear in future releases of the
  691. XPoplog Widget Set.
  692. X
  693. XThe Poplog widgets are arranged in a hierarchy. For example, the
  694. XPopGraphic widget class is below the PopPixmap widget class, which is
  695. Xin turn below the PopCore widget class in the hierarchy. Because of
  696. Xthis, any graphics widgets will inherit all the properties of Pixmap
  697. XWidgets and PopCore widgets. The graphics widget uses the Pixmap widgets
  698. Xproperties (ie. the pixmap) to store a copy of the contents of the
  699. Xwindow.
  700. X
  701. XThe Widget Hierarchy is broken into two parts: The PopCore part is the
  702. Xstem of the main Poplog widget set, but the two additional widgets are
  703. Xjust specialisations of already existing widget classes.
  704. X
  705. XThe Hierarchy looks like this:
  706. X
  707. X
  708. X              Composite --------> PopComposite
  709. X            /                     ^^^^^^^^^^^^
  710. X           /
  711. X          /                     / PopScrollText
  712. X         /                     /  ^^^^^^^^^^^^^
  713. XCore ---{-- PopCore   --------{
  714. X         \  ^^^^^^^            \
  715. X          \                     \ PopPixmap    --------> PopGraphic
  716. X           \                      ^^^^^^^^^              ^^^^^^^^^^
  717. X   (Athena widget set)
  718. X              \
  719. X               Text   ----------> AsciiString  --------> PopText
  720. X                                                         ^^^^^^^
  721. X
  722. X
  723. XThe Poplog Widgets in this hierarchy are designed to be used in addition
  724. Xto other widgets, such as the MOTIF widget set, or the ATHENA widget
  725. Xset.
  726. X
  727. X
  728. X-- The PopCore Widgets ---------------------------------------------------
  729. X
  730. X
  731. XMethods
  732. X
  733. XThe PopCore widget and its descendants have a special interface mechanism
  734. Xcalled 'methods' that allow relevant procedures for those widgets to be
  735. Xaccessed from a single C procedure. This reduces the number of external
  736. Xprocedures that have to be loaded within Poplog. For more information about
  737. Xthe method system, see SYSDOC *PopWidgets.imp and REF *XpwMethods. 
  738. X
  739. XNaming Conventions
  740. X
  741. XThe PopCore widgets follow the Athena Widget set naming convents, except that
  742. Xall of the procedures relating to the widget set start with the root 'Xpw'
  743. Xinstead of 'Xt' or 'Xaw'. For example, the method access procedure is called
  744. XXpwCallMethod. Method Identifiers are called XpwM<name>.
  745. X
  746. X-- Loading Poplog Widget Set ------------------------------------------
  747. X
  748. XThe Poplog Widgets can be loaded in Poplog using the LIB *xt_load_wc system.
  749. XHowever, the recommended way of loading the Widgets is via a group of
  750. Xlibrary packages:
  751. X
  752. X
  753. X    LIB *PopCore       - loads the PopCore widget class.
  754. X
  755. X    LIB *PopPixmap     - loads the PopPixmap widget class.
  756. X
  757. X    LIB *PopGraphic    - loads the PopCore, PopPixmap and PopGraphic
  758. X                 widget classes.
  759. X
  760. X    LIB *PopScrollText - loads the PopCore and PopScrollText widget
  761. X                             classes.
  762. X
  763. X    LIB *PopComposite  - loads the PopComposite widget class.
  764. X
  765. X    LIB *PopText       - loads the Text, AsciiString and PopText widget
  766. X                             classes.
  767. X
  768. X    LIB *PopWidgets       - loads all of the above libraries. This is a
  769. X                 more efficient method than loading each
  770. X                 library in turn.
  771. X
  772. XEach library package uses xt_load_wc to load the requested widgets,
  773. Xand then defines a group of Pop-11 procedures that act as the Poplog
  774. Xinterface to those widgets. For information about using the widgets, see
  775. Xthe relevant documenation listed below.
  776. X
  777. X
  778. X-- Related Documentation ----------------------------------------------
  779. X
  780. XThere are two main sources of documentation regarding the Poplog Widget
  781. XSet:
  782. X
  783. X1) A set of REF files describes each of the widgets in the Set:
  784. X
  785. X    REF *PopCore
  786. X    REF *PopPixmap
  787. X    REF *PopGraphic
  788. X    REF *PopScrollText
  789. X    REF *PopComposite
  790. X    REF *PopText
  791. X
  792. X2) A related set of HELP files describes using more general terms the
  793. XPop-11 library packages that are used in conjunction with the widgets:
  794. X
  795. X    HELP *PopGraphic - graphics utilites using PopPixmap/PopGraphic.
  796. X    HELP *PopScrollText - text manipulation using PopScrollText.
  797. X    HELP *PopComposite - Composite widget manipulation using callbacks.
  798. X    HELP *PopText - a simple text editor that interacts with Poplog.
  799. X
  800. XAdditional documentation includes:
  801. X
  802. X    SYSDOC *PopWidgets.imp - discusses some implementation details of
  803. X                 the Poplog Widget Set.
  804. X
  805. X    HELP *PopWidgets.news  - latest developements and changes.
  806. X
  807. X    HELP *PopWidgets.index - pointers to help files.
  808. X
  809. X        REF *XpwMethods        - index of Poplog Widget methods
  810. X
  811. X        REF *XpwResources      - index of Poplog Widget resources
  812. END_OF_FILE
  813. if test 7446 -ne `wc -c <'doc/help/PopWidgets'`; then
  814.     echo shar: \"'doc/help/PopWidgets'\" unpacked with wrong size!
  815. fi
  816. # end of 'doc/help/PopWidgets'
  817. fi
  818. if test -f 'doc/help/PopWidgets.news' -a "${1}" != "-c" ; then 
  819.   echo shar: Will not clobber existing file \"'doc/help/PopWidgets.news'\"
  820. else
  821. echo shar: Extracting \"'doc/help/PopWidgets.news'\" \(1659 characters\)
  822. sed "s/^X//" >'doc/help/PopWidgets.news' <<'END_OF_FILE'
  823. XHELP POPWIDGETS.NEWS                        Jonathan Meyer, Jan 1990
  824. X
  825. XThis is Revision 3 of the Poplog Widget Set. Changes since the previous
  826. Xrevisions include:
  827. X
  828. XSoftware changes
  829. X
  830. X    o   Graphics Context fields are now resources of PopPixmap.
  831. X        These work using resource subparts and the {Get,Set}Values_hook
  832. X
  833. X    o   Rationalized all resources, modified SetValue procs to do more checks
  834. X        renamed actions to comply with Intrinsics naming conventions.
  835. X
  836. X    o   Added "Methods" to Poplog widgets so that graphics/text procedures
  837. X        are called using XpwCallMethod (see HELP *XpwMethods)
  838. X
  839. X    o   Made methods use hashing tables for faster access
  840. X
  841. X    o   Numerous bug fixes for the PopScrollWidget class (ie. make it work!)
  842. X
  843. X    o   Made PopText a subclass of AsciiText instead of a modified text
  844. X        widget
  845. X
  846. X    o   Several new methods. Better colour handling - PopAllocColorRange
  847. X        PopCreateColormap, etc.
  848. X
  849. X    o   Caches for fonts, colours and cursors, for PopCore and subclasses.
  850. X
  851. X
  852. XStructural changes
  853. X
  854. X    o   Changed file names so that they are 14 character long (for SysV)
  855. X
  856. X    o   Simplified Makefile (it's still not perfect)
  857. X
  858. X    o   Introduced the Imake mechanism
  859. X
  860. X    o   Reorganised the file/directory structure
  861. X
  862. X
  863. XThings still to do
  864. X
  865. X    o   Some form of rigerous testing
  866. X
  867. X    o   Additional utilities and drawing functions above and beyond Xlib
  868. X
  869. X    o   Complete Documentation on internal workings of widget set
  870. X
  871. X    o    Selections for PopScrollText widgets
  872. X
  873. X    o   Generic widgets?
  874. X
  875. XFor more information, see:
  876. X
  877. X    HELP *PopWidgets,
  878. X    HELP *PopGraphic, *PopText, *PopScrollText, XpwMethods.
  879. X    SYSDOC *PopWidgets.imp
  880. X
  881. END_OF_FILE
  882. if test 1659 -ne `wc -c <'doc/help/PopWidgets.news'`; then
  883.     echo shar: \"'doc/help/PopWidgets.news'\" unpacked with wrong size!
  884. fi
  885. # end of 'doc/help/PopWidgets.news'
  886. fi
  887. if test -f 'doc/ref/PopComposite' -a "${1}" != "-c" ; then 
  888.   echo shar: Will not clobber existing file \"'doc/ref/PopComposite'\"
  889. else
  890. echo shar: Extracting \"'doc/ref/PopComposite'\" \(3912 characters\)
  891. sed "s/^X//" >'doc/ref/PopComposite' <<'END_OF_FILE'
  892. XREF *PopComposite                              Jonathan Meyer, Jan 1990
  893. X
  894. XPoplog Widget Set, revision 3.
  895. X
  896. X
  897. XThis file describes the PopComposite widget class, which is part of the
  898. XPoplog Widget Set. For details of other widgets in the Poplog Widget
  899. XSet, see HELP *PopWidgets. For information about the Pop-11 interface to
  900. Xthe PopComposite widget, see HELP *PopComposite.
  901. X
  902. X         CONTENTS - (Use <ENTER> g to access required sections)
  903. X
  904. X -- PopComposite Widget
  905. X -- PopComposite Resources
  906. X -- Resource Notes
  907. X -- Actions and Translations
  908. X
  909. X-- PopComposite Widget ------------------------------------------------
  910. X
  911. XSuperclass: Composite.
  912. X
  913. XThe PopComposite Widget class is similar to PopCore, in that it adds a
  914. Xcallback to an existing widget class, in this case the Composite widget.
  915. XThe PopComposite widget uses the callback to notify applications when
  916. Xevents (like adding children, or resizing) occur. The PopComposite widget
  917. Xis used to manage a set of other widgets, called children. Programmers
  918. Xuse the callback to calculate the geometry of all the children of the widget.
  919. XUnlike the Form widget, no specification technique for widget location is used.
  920. XBy default, all geometry requests are accepted.
  921. X
  922. XBecause the PopComposite widget notifies applications of resize events,
  923. Xand the applications have access to the children of the widget, complex
  924. Xgemoetry  and location calculations for children of the widget can be
  925. Xperformed within the callback.
  926. X
  927. X-- PopComposite Resources ---------------------------------------------
  928. X
  929. XThe following resources are retrieved from the argument list or the resource 
  930. Xdatabase when PopComposite widgets are created.
  931. X
  932. X===============================================================================
  933. XName            Class        RepType    Default*   Description
  934. X===============================================================================
  935. XXtNwidth        Width        Dimension  200        Window width
  936. XXtNheight       Height       Dimension  100        Window height
  937. XXtNx            X            Position   0          X coordinate in pixels 
  938. XXtNy            Y            Position   0          Y coordinate in pixels
  939. XXtNborderWidth  BorderWidth  Dimension  1          Border width in pixels
  940. XXtNborderPixmap BorderPixmap Pixmap     None       Window border pixmap
  941. XXtNborderColor  BorderColor  Pixel      foreground Window border color
  942. XXtNbackground   Background   Pixel      XtDefault  Window background color
  943. XXtNtranslations Translations String     see below  Event-to-action translations
  944. XXtNpopCallback  Callback     Pointer    NULL       Callbacks for events
  945. XXtNdestroyCallback           Callback   NULL       XtDestroyWidget callback
  946. XXtNmappedWhenManaged         Boolean    TRUE       automatic XtMapWidget
  947. X
  948. X* default values listed as XtDefault are in fact set to the string
  949. X  XtDefault<Class> where Class is the class name of that resource, eg.
  950. X  'XtDefaultForeground', 'XtDefaultFont' etc.
  951. X
  952. X
  953. X-- Resource Notes -------------------------------------------------------------
  954. X
  955. XThe following notes describe new resources or properties of resources for 
  956. XPopComposite widgets.  
  957. X
  958. XXtNpopCallback
  959. X    This callback list is used notify clients of events. See below.
  960. X
  961. XXtNpointerShape
  962. X    This resource defines the cursor that should be displayed when the pointer
  963. X    is in the window of the widget. Applications can create a cursor (using
  964. X    XCreateFontCursor for example), and then set this resource. Setting this
  965. X    resource causes an XDefineCursor call, unless the new cursor that is
  966. X    specified is NULL, in which case XUndefineCursor is used instead.
  967. X
  968. X
  969. X-- Actions and Translations -------------------------------------------
  970. X
  971. X
  972. XPopComposite has one action: NotifyConfigureEvent. It has one default
  973. XTranslation:
  974. X
  975. X    "<Configure>:   notify-configure-event()\n"
  976. X
  977. XThe notify-configure-event action calls the XtNpopCallback list. Configure
  978. Xevents include resize events and adding children.
  979. END_OF_FILE
  980. if test 3912 -ne `wc -c <'doc/ref/PopComposite'`; then
  981.     echo shar: \"'doc/ref/PopComposite'\" unpacked with wrong size!
  982. fi
  983. # end of 'doc/ref/PopComposite'
  984. fi
  985. if test -f 'doc/ref/PopCore' -a "${1}" != "-c" ; then 
  986.   echo shar: Will not clobber existing file \"'doc/ref/PopCore'\"
  987. else
  988. echo shar: Extracting \"'doc/ref/PopCore'\" \(12566 characters\)
  989. sed "s/^X//" >'doc/ref/PopCore' <<'END_OF_FILE'
  990. XREF *PopCore                                   Jonathan Meyer, Jan 1990
  991. X
  992. XPoplog Widget Set, revision 3.
  993. X
  994. XThis file describes the PopCore widget class, which is part of the
  995. XPoplog Widget Set. For details of other widgets in the Poplog Widget
  996. XSet, see HELP *PopWidgets. For information about the Pop-11 interface to
  997. Xthis widget, see HELP *PopCore.
  998. X
  999. X
  1000. X         CONTENTS - (Use <ENTER> g to access required sections)
  1001. X
  1002. X -- PopCore Widget
  1003. X -- PopCore Resources
  1004. X -- Resource Notes
  1005. X -- Further Notes
  1006. X -- Actions
  1007. X -- Translations
  1008. X -- Methods
  1009. X
  1010. X-- PopCore Widget -----------------------------------------------------
  1011. X
  1012. XSuperclass: Core
  1013. X
  1014. XThe PopCore widget is similar to the Core widget class but with  more
  1015. Xresources, and a callback list that is activated through an action. You
  1016. Xcan specify the events that the callback is activated on using the
  1017. Xtranslation table. The PopCore widget has a Graphics Context, which is
  1018. Xused to hold resources like line width, line style, foreground and
  1019. Xbackground colours etc. This graphics context is used by subclasses of the
  1020. XPopCore widget class in graphics and text operations.
  1021. X
  1022. XThe PopCore widget class is intended as a base for building more
  1023. Xsophisticated widget classes. As such, it is probably of limited use to
  1024. Xapplications, which will probably use subclasses of PopCore, such as the
  1025. XPopGraphic widget class.
  1026. X
  1027. XThe class variable for the PopCore widget is popCoreWidgetClass.
  1028. X
  1029. X-- PopCore Resources ----------------------------------------------------------
  1030. X
  1031. XThe following resources are retrieved from the argument list or the resource
  1032. Xdatabase when PopCore widgets are created.
  1033. X
  1034. X===============================================================================
  1035. XName            Class        RepType    Default*   Description
  1036. X===============================================================================
  1037. XXtNwidth        Width        Dimension  200        Window width
  1038. XXtNheight       Height       Dimension  100        Window height
  1039. XXtNx            X            Position   0          X coordinate in pixels 
  1040. XXtNy            Y            Position   0          Y coordinate in pixels
  1041. XXtNborderWidth  BorderWidth  Dimension  1          Border width in pixels
  1042. XXtNborderPixmap BorderPixmap Pixmap     None       Window border pixmap
  1043. XXtNborderColor  BorderColor  Pixel      foreground Window border color
  1044. XXtNbackground   Background   Pixel      XtDefault  Window background color
  1045. XXtNforeground   Foreground   Pixel      XtDefault  Window foreground color
  1046. XXtNfont         Font         FontStruct XtDefault  Font for text operations
  1047. XXtNpointerShape Cursor       Cursor     None       mouse cursor(cursorfont)
  1048. XXtNtranslations Translations String     see below  Event-to-action translations
  1049. XXtNpopCallback  Callback     Pointer    NULL       Callbacks for events
  1050. XXtNautoFlush    Boolean      Boolean    TRUE       XFlush after methods?
  1051. XXtNusersGC      GC           Pointer    NULL       Graphics Context for ops
  1052. XXtNmodifiers    Parameter    Int        None       event->state modifiers
  1053. XXtNdestroyCallback           Callback   NULL       XtDestroyWidget callback
  1054. XXtNmappedWhenManaged         Boolean    TRUE       automatic XtMapWidget
  1055. X
  1056. X* default values listed as XtDefault are in fact set to the string
  1057. X  XtDefault<Class> where Class is the class name of that resource, eg.
  1058. X  'XtDefaultForeground', 'XtDefaultFont' etc.
  1059. X
  1060. X
  1061. X-- Resource Notes -------------------------------------------------------------
  1062. X
  1063. XThe following notes describe new resources or properties of resources for
  1064. XPopCore widgets.
  1065. X
  1066. X
  1067. XXtNwidth, XtNheight
  1068. X    Changing a widgets width or height resource will cause a Resize request.
  1069. X
  1070. XXtNforeground, XtNbackground
  1071. X    foreground and background can be changed using XtSetValues. This causes
  1072. X    an XChangeGC on the users GC. Valid pixel values must be provided. 
  1073. X
  1074. XXtNautoFlush
  1075. X    This resource is inspected after calling a Poplog Widget Method. (See
  1076. X    REF *XpwCallMethod, REF *XpwMethods for more).  If its value is TRUE,
  1077. X    an XFlush is issued. By setting it FALSE, users can perform several
  1078. X    method calls at once. When the resource is set to TRUE, XFlush is 
  1079. X    called. The following code fragment shows how autoFlush can be used:
  1080. X
  1081. X    XtSetValue(widget, XtNautoFlush, FALSE);
  1082. X
  1083. X    /* put multiple method calls inside "autoFlush" brackets */
  1084. X    i = 100;
  1085. X    while (i--)
  1086. X       XpwCallMethod(widget, XpwMDrawPoint, random(100),random(100));
  1087. X
  1088. X    XtSetValue(widget, XtNautoFlush, TRUE);
  1089. X
  1090. X    Setting this resource TRUE increments an internal counter. Setting it 
  1091. X    FALSE decrements the counter. An XFlush is only performed if the counter 
  1092. X    has reached 0.
  1093. X
  1094. XXtNpointerShape
  1095. X    This resource defines the cursor that should be displayed when the pointer
  1096. X    is in the window of the widget. Applications can create a cursor (using
  1097. X    XCreateFontCursor for example), and then set this resource. Alternatively,
  1098. X    they can use the XpwMSetCursor method (see below). Setting this resource
  1099. X    causes  an XDefineCursor call, unless the new cursor that is specified is
  1100. X    NULL, in which case XUndefineCursor is used instead.
  1101. X
  1102. XXtNfont
  1103. X    This resource is a pointer to an XFontStruct. Applications can load their
  1104. X    own fonts, using XLoadQueryFont, and then set this resource. Alternatively,
  1105. X    they can use the XpwMSetFont method (see below). All subclasses of PopCore
  1106. X    use this font as their main/default font, although they may supplement it
  1107. X    with additional fonts. Setting this resource modifies the usersGC resource.
  1108. X
  1109. XXtNusersGC
  1110. X    This resource holds a pointer to the widgets graphics context (GC).
  1111. X    Subclasses of PopCore all use the 'usersGC' held in the PopCore part
  1112. X    of the widget structure to perform their graphics and text operations.
  1113. X    Subclasses provide resources for altering relevant parts of the GC values.
  1114. X    The PopCore widget provides foreground, background and font resource for
  1115. X    this purpose. See Xlib Programming Manual, vol. 1, Ch. 6 for more on GC's.
  1116. X    Changing 'usersGC' will cause the previous GC to be released.
  1117. X
  1118. XXtNmodifiers
  1119. X    This is set to event->state after any events in the widgets window.
  1120. X    This resource reflects the modifiers (shift, ctrl, meta) etc. which are
  1121. X    in use when the event occured. Event handlers are expected to need this
  1122. X    information.
  1123. X
  1124. X
  1125. X-- Further Notes -----------------------------------------------------------
  1126. X
  1127. XThe Users Graphics Context
  1128. X
  1129. XThe usersGC resource has many other derived resources relating to it,
  1130. Xincluding foreground, background, font, and others.
  1131. X
  1132. XThe PopCore widget tries to minimise the number of XChangeGC calls.
  1133. XUsing XtSetValues to set more than one graphics context field resource at
  1134. Xonce is much more efficient than changing one resource at a time.
  1135. X
  1136. XThe PopCore widget also tries to share the usersGC. If you create
  1137. Xmany widgets which all have the same graphics context values, they will all
  1138. Xshare the same GC. Using XtSetValues to change fields in a usersGC
  1139. Xfor a widget will cause that widget to release its shared graphics context
  1140. Xand use a unique one. For this reason, you should not modify the usersGC
  1141. Xdirectly unless you are sure that it is no longer a shared GC. You can
  1142. Xensure this by changing one of the fields of the GC using XtSetValues before
  1143. Xusing Xlib routines to change other fields in the GC.
  1144. X
  1145. XFor more resources derived from the usersGC, see REF *PopPixmap.
  1146. X
  1147. X-- Actions ---------------------------------------------------------------
  1148. X
  1149. XThe PopCore widget class has one action, called "notify-event", that
  1150. Xcalls the XtNpopCallback list.
  1151. X
  1152. X-- Translations -----------------------------------------------------------
  1153. X
  1154. XThe PopCore widget does not perform any event processing in its translation
  1155. Xtable. This is left to the programmer - widgets below PopCore in the
  1156. XPoplog Widget Set differentiate events, and call callback lists based on
  1157. Xevent type. The application could create a PopCore widget with the following
  1158. Xtranslations:
  1159. X
  1160. X    "<ResReq>: notify-event() \n\
  1161. X     <Expose>: notify-event() "
  1162. X
  1163. X-- Methods ---------------------------------------------------------------
  1164. X
  1165. XPopCore widgets respond to six methods: XpwMSetColor, XpwMFreeColor,
  1166. XXpwMSetFont, XpwMFreeFont, XpwMSetCursor and XpwMFreeCursor. These methods
  1167. Xemploy caches so that the application can repeatedly change colors, fonts
  1168. Xand cursors without expensive calls to the X Server.
  1169. X
  1170. XMethod Name         Arguments                 Notes
  1171. X========================================================================
  1172. XXpwMSetColor        string                    either name or #rgb format
  1173. XXpwMFreeColor       string
  1174. XXpwMSetFont         string
  1175. XXpwMFreeFont        string
  1176. XXpwMSetCursor       shape                  shape in cursorfont.h
  1177. XXpwMFreeCursor      shape                     eg. XC_crosshair
  1178. X
  1179. X
  1180. XXpwMSetColor
  1181. X    XpwCallMethod(widget, XpwMSetColor, name);
  1182. X    Widget widget;
  1183. X    String name;
  1184. X
  1185. X    This method is used to set the foreground of a widget to the named color.
  1186. X    It works as follows: if the color cache has not yet been initialized,
  1187. X    a new cache is created, with two entries - XtDefaultForeground and 
  1188. X    XtDefaultBackground. The first entry is used if the name string is NULL. 
  1189. X    If the name string isn't null, it is converted into a lowercase quark, and 
  1190. X    the cache is searched for an entry whose key is that quark. If an entry 
  1191. X    does not exist, and a call to XParseColor/XAllocColor is successful, the 
  1192. X    returned color is added to the cache. If both attempts to locate the color 
  1193. X    fail, the method returns with a result of zero. Otherwise, the method uses 
  1194. X    XtSetValues to set the foreground of the widget, and returns with the 
  1195. X    new color's pixel value.
  1196. X
  1197. XXpwMFreeColor
  1198. X    XpwCallMethod(widget, XpwMFreeColor, name);
  1199. X    Widget widget;
  1200. X    String name;
  1201. X
  1202. X    PopFreeColor will search the color cache for the named color. If
  1203. X    an entry in the cache exists, the related XColor is released using
  1204. X    XFreeColor, and the cache entry is removed. You cannot free the XtDefault
  1205. X    cache entries -they are always available to XpwMSetColor calls. If you free
  1206. X    a color which is the current foreground of the widget, the method calls 
  1207. X    XpwMSetColor to set the foreground of the widget to the default foreground.
  1208. X
  1209. XXpwMSetFont
  1210. X    XpwCallMethod(widget, XpwMSetFont, fontname);
  1211. X    Widget widget;
  1212. X    String fontname;
  1213. X
  1214. X    This method works as follows: if the font cache has not yet been
  1215. X    initialized, a new cache is created, with one entry - XtDefaultFont. 
  1216. X    This entry is used if the fontname string is NULL. If the fontname string 
  1217. X    isn't null, it is converted into a lowercase quark, and the cache is 
  1218. X    searched for an entry whose key is that quark. If an entry does not exist, 
  1219. X    and a call to XLoadQueryFont is successful, the returned font is added to 
  1220. X    the cache. If both attempts to locate the font fail, the method returns 
  1221. X    with a result of zero. Otherwise, the method uses XtSetValues to set the 
  1222. X    font of the widget, and the method returns with the font's ID.
  1223. X
  1224. XXpwMFreeFont
  1225. X    XpwCallMethod(widget, XpwMFreeFont, fontname);
  1226. X    Widget widget;
  1227. X    String fontname;
  1228. X
  1229. X    PopFreeFont will search the font cache for a font whose name is fontname. 
  1230. X    If an entry in the cache exists, the related XFontStruct is released using 
  1231. X    XFreeFont, and the cache entry is removed. You cannot free the XtDefaultFont
  1232. X    cache entry - this font is always available to XpwMSetFont calls. If you 
  1233. X    free a font which is the current font for the widget, the method calls 
  1234. X    XpwMSetFont to set the font of the widget to the default font.
  1235. X
  1236. XXpwMSetCursor
  1237. X    XtPopCallMethod(widget, XpwMSetCursor, shape);
  1238. X    Widget widget;
  1239. X    Cardinal shape;
  1240. X
  1241. X    XpwMSetCursor first checks to see if the cursor cache exists. If it does
  1242. X    not exist, a new cache is created, with no entries. Otherwise the cache
  1243. X    is searched for the requested cursor shape (XC_crosshair, XC_arrow etc).
  1244. X    If an entry in the cache does not exist, the method calls XCreateFontCursor
  1245. X    to load the requested cursor shape, which is then added to the cache. 
  1246. X    Then the method uses XtSetValues to set the pointerShape resource of the 
  1247. X    widget. The cursor returned from XCreateFontCursor is returned.
  1248. X
  1249. XXpwMFreeCursor
  1250. X    XpwCallMethod(widget, XpwMFreeCursor, shape);
  1251. X    Widget widget;
  1252. X    Cardinal shape;
  1253. X
  1254. X    This method first checks the cursor cache for an entry corrosponding to
  1255. X    shape. If that entry exists, PopFreeCursor uses XFreeCursor to release the 
  1256. X    memory associated with the cursor. If the current cursor for the widget is
  1257. X    the same as shape, XtSetValues is used to set the cursor to the server 
  1258. X    default (ie. using XUndefineCursor).
  1259. END_OF_FILE
  1260. if test 12566 -ne `wc -c <'doc/ref/PopCore'`; then
  1261.     echo shar: \"'doc/ref/PopCore'\" unpacked with wrong size!
  1262. fi
  1263. # end of 'doc/ref/PopCore'
  1264. fi
  1265. if test -f 'doc/ref/PopGraphic' -a "${1}" != "-c" ; then 
  1266.   echo shar: Will not clobber existing file \"'doc/ref/PopGraphic'\"
  1267. else
  1268. echo shar: Extracting \"'doc/ref/PopGraphic'\" \(13333 characters\)
  1269. sed "s/^X//" >'doc/ref/PopGraphic' <<'END_OF_FILE'
  1270. XREF *PopGraphic                                 Jonathan Meyer, Jan 1990
  1271. X
  1272. X
  1273. XPoplog Widget Set, revision 3.
  1274. X
  1275. XThis file describes the PopGraphic widget class, which is part of the
  1276. XPoplog Widget Set. For details of other widgets in the Poplog Widget
  1277. XSet, see HELP *PopWidgets. For details of the Pop-11 interface to the
  1278. XPopGraphic widget class, see HELP *PopGraphic.
  1279. X
  1280. X
  1281. X
  1282. X         CONTENTS - (Use <ENTER> g to access required sections)
  1283. X
  1284. X -- PopGraphic Widget
  1285. X -- Resources
  1286. X -- Resource Notes
  1287. X -- PopGraphic Actions
  1288. X -- PopGraphic Translations
  1289. X -- Methods
  1290. X -- PopGraphic Methods
  1291. X
  1292. X
  1293. X-- PopGraphic Widget ---------------------------------------------------
  1294. X
  1295. XSuperclass: PopPixmap
  1296. X
  1297. XA PopGraphic widget is a general purpose window. Any of the Xlib
  1298. Xgraphics primatives can be applied to the widget. Because it is a
  1299. Xsubclass of PopPixmap, it has a pixmap associated with it, which is
  1300. Xautomatically set to be the same size as the window. Any graphics
  1301. Xoperations are duplicated on the pixmap, which is used to restore the
  1302. Xcontents of the window after resize and exposure events. PopGraphic
  1303. Xwidgets use callbacks to notify applications of events. They also
  1304. Xhave colormap manipulation methods.
  1305. X
  1306. XThere are a variety of operations that can be performed on Graphics
  1307. Xwidgets. They are all accessed using the PopCore Method Calling
  1308. Xinterface. See HELP *PopGraphic and LIB *PopGraphic for Pop-11
  1309. Xinterfaces to the methods available to graphics widgets. See 
  1310. XREF *XpwMethods for more information about methods.
  1311. X
  1312. XAlthough the PopGraphic widget class is fairy simple, it is also very
  1313. Xuseful. Programmers can use graphics widgets as general purpose windows
  1314. Xto display textual or graphical output, without having to worry about
  1315. Xcomplex details such as (exposure) events and colormaps.
  1316. X
  1317. XThe class variable of PopGraphic is popGraphicWidgetClass.
  1318. X
  1319. X-- Resources --------------------------------------------------------------
  1320. X
  1321. X
  1322. XPopGraphic inherits all of the resources of PopCore and PopPixmp. The following
  1323. Xresources are retrieved from the argument list or the resource database
  1324. Xwhen PopGraphic widgets are created.
  1325. X
  1326. X===============================================================================
  1327. XName            Class        RepType    Default*   Description
  1328. X===============================================================================
  1329. XXtNwidth        Width        Dimension  200        Window width
  1330. XXtNheight       Height       Dimension  100        Window height
  1331. XXtNx            X            Position   0          X coordinate in pixels
  1332. XXtNy            Y            Position   0          Y coordinate in pixels
  1333. XXtNborderWidth  BorderWidth  Dimension  1          Border width in pixels
  1334. XXtNborderPixmap BorderPixmap Pixmap     None       Window border pixmap
  1335. XXtNborderColor  BorderColor  Pixel      foreground Window border color
  1336. XXtNbackground   Background   Pixel      XtDefault  Window background color
  1337. XXtNforeground   Foreground   Pixel      XtDefault  Window foreground color
  1338. XXtNfont         Font         FontStruct XtDefault  Font for text operations
  1339. XXtNpointerShape Cursor       Cursor     None       mouse cursor(cursorfont)
  1340. XXtNtranslations Translations String     see below  Event-to-action translations
  1341. XXtNpopCallback  Callback     Pointer    NULL       Callbacks for events
  1342. XXtNautoFlush    Boolean      Boolean    TRUE       XFlush after methods?
  1343. XXtNusersGC      GC           Pointer    NULL       Graphics Context for ops
  1344. XXtNmodifiers    Parameter    Int        None       event->state modifiers
  1345. XXtNdestroyCallback           Callback   NULL       XtDestroyWidget callback
  1346. XXtNmappedWhenManaged         Boolean    TRUE       automatic XtMapWidget
  1347. XXtNfunction      Function      Int      XtDefault  GC drawing mode
  1348. XXtNsubwindowMode SubWindowMode Int      XtDefault  GC subwindow mode
  1349. XXtNlineWidth     LineWidth     Int      XtDefault  GC line width
  1350. XXtNlineStyle     LineStyle     Int      XtDefault  GC line style
  1351. XXtNcapStyle      CapStyle      Int      XtDefault  GC cap style
  1352. XXtNjoinStyle     JoinStyle     Int      XtDefault  GC join style
  1353. XXtNprivateGC     GC            Pointer  None       Pixmap Graphics Context 
  1354. XXtNpixmap        Pixmap        Pointer  None       Pixmap of Widget.
  1355. XXtNpixmapStatus  PixmapStatus  Cardinal PixmapOn   Is Pixmap active?
  1356. XXtNusePrivateGC  Boolean       Boolean    TRUE       See below
  1357. XXtNmyGC          GC            Pointer    NULL       GC for window refresh
  1358. XXtNswitchCmaps   Boolean       Boolean    FALSE      Automatic cmap install
  1359. XXtNmouseX        MouseLocation Int        None       Mouse X location in pixels
  1360. XXtNmouseY        MouseLocation Int        None       Mouse Y location in pixels
  1361. XXtNbuttonEvent   Callback      Pointer    NULL       Called on ButtonPress
  1362. XXtNkeyboardEvent Callback      Pointer    NULL       Called on KeyPress
  1363. XXtNmouseEvent    Callback      Pointer    NULL       Called on Enter/Leave
  1364. XXtNmotionEvent   Callback      Pointer    NULL       Called on mouse Motion
  1365. XXrNresizeEvent   Callback      Pointer    NULL       Called on Resize Req
  1366. X
  1367. X* default values listed as XtDefault are in fact set to the string
  1368. X  XtDefault<Class> where Class is the class name of that resource, eg.
  1369. X  'XtDefaultLineWidth', 'XtDefaultLineStyle' etc.
  1370. X
  1371. X
  1372. X-- Resource Notes -----------------------------------------------------
  1373. X
  1374. XXtNusePrivateGC
  1375. X    The XtNusePrivateGC resource specifies which of the two available
  1376. X    Graphics Contexts should be used to restore the contents of the window
  1377. X    after an exposure or resize event.
  1378. X
  1379. X    If 'usePrivateGC' is TRUE, the Graphics Context from the poppixmap part
  1380. X    of the widget is used (ie. 'privateGC'). This GC is set to the default
  1381. X    server GC, and should not be changed. If 'usePrivateGC' is FALSE, the
  1382. X    graphics context from the popcore part of the widget is used (ie.
  1383. X    'usersGC'). This graphics context can by modified using the GC
  1384. X    resources (see above). The default value is TRUE. The resource 'myGC'
  1385. X    points to the graphics context that is currently being used to restore
  1386. X    the window from the pixmap. This is either 'usersGC' or 'privateGC', but
  1387. X    should not be modified by applications.
  1388. X
  1389. X    This use of two graphics contexts is designed so that applications can 
  1390. X    choose to have changes in the users graphics context affect the appearence 
  1391. X    of the overall window after exposure or resize events. For example, altering
  1392. X    the background colour of the usersGC to red would cause the whole window
  1393. X    to become red (assuming usePrivateGC was FALSE). However, many
  1394. X    applications would not want changes to the usersGC to affect the
  1395. X    appearence of the whole window.
  1396. X
  1397. X
  1398. XXtNswitchCmaps
  1399. X    The 'switchCmaps' resource determines whether the graphics widget should
  1400. X    perform its own Colormap switching, if the widget has a different
  1401. X    colormap from the default colormap of the screen. If switchCmaps is
  1402. X    TRUE, the widget will call XInstallColormap to switch to its own
  1403. X    colormap on EnterNotify events, and XUninstallColormap to revert to the
  1404. X    default colormap on LeaveNotify events. Window managers should do this for
  1405. X    the window automatically. Interclient conventions state that windows should
  1406. X    not use XInstall/UninstallColormap. However, the ability to perform colormap
  1407. X    switching can be useful, especially if your favourite window manager does
  1408. X    not perform this operation for you!
  1409. X
  1410. X
  1411. XXtNpixmapStatus
  1412. X    If the PopPixmap resource pixmapStatus is either PixmapOff or PixmapHasNone,
  1413. X    the PopGraphic widget calls the 'popCallback' callback list to notify the
  1414. X    client of exposure events.
  1415. X
  1416. XXtNmouseX, XtNmouseY
  1417. X    The 'mouseY' and 'mouseX' resources are set by the widget whenever a
  1418. X    new event occurs. They can be read by the application to determine the
  1419. X    mouse location, in pixels.
  1420. X
  1421. X
  1422. XbuttonEvent, keyboardEvent, mouseEvent, motionEvent, resizeEvent
  1423. X    The *Event resources are Callback Lists. They should not be updated.
  1424. X    Users can add procedures to one of these callback list using
  1425. X    XtAddCallback, specifying which event they are interested in trapping.
  1426. X    See HELP *XT_CALLBACKS for more information. For example, adding foo as
  1427. X    a callback procedure for motionEvents would look something like:
  1428. X
  1429. X        XtAddCallback(widget, XtNmotionEvent, foo, false)
  1430. X
  1431. X    Notice that the resources 'mouseX', 'mouseY' and 'modifiers' are set before
  1432. X    a client is notified of an event - clients can read these resources to 
  1433. X    determine what action to take.
  1434. X
  1435. X-- PopGraphic Actions -------------------------------------------------
  1436. X
  1437. XThe following actions are avaliable for PopGraphic widgets. Actions
  1438. Xcall their associated callback list with data extracted from the event
  1439. Xand the arguments to the action.
  1440. X
  1441. X Name                    Event                Call Data
  1442. X ----                    ------------------   ---------------------
  1443. X notify-button-event     ButtonPress/Release  +/-Button number
  1444. X notify-keyboard-event   Key press            +/-Keysym of key
  1445. X notify-motion-event     Mouse Motion         Button number, or 0
  1446. X notify-mouse-event      Mouse Enter/Leave    Event type
  1447. X notify-resize-event     Resize request       Event type
  1448. X
  1449. XA ButtonPress or KeyPress event's call data is positive. A ButtonRelease/
  1450. XKeyRelease event's call data is negative. For example, pushing button 3
  1451. Xdown will first call XtNbuttonEvent with 3, and then -3.
  1452. X
  1453. X
  1454. X-- PopGraphic Translations --------------------------------------------
  1455. X
  1456. XThe default translations for Graphics widgets is as follows:
  1457. X
  1458. X    "<BtnDown>:         notify-button-event() \n\
  1459. X     <BtnUp>:           notify-button-event() \n\
  1460. X     <EnterWindow>:     notify-mouse-event() \n\
  1461. X     <LeaveWindow>:     notify-mouse-event() \n\
  1462. X     <Motion>:            notify-motion-event() \n\
  1463. X     <ResReq>:            notify-resize-event() \n\
  1464. X     <KeyPress>:        notify-keyboard-event() \n\
  1465. X     <KeyRelease>:      notify-keyboard-event()";
  1466. X
  1467. X-- Methods -------------------------------------------------------------
  1468. X
  1469. XThe PopGraphic widget  inherits all of the methods of the PopPixmap
  1470. Xwidget class, and also adds a few new methods.
  1471. X
  1472. XMethod Name         Xlib function     Args
  1473. X============================================================
  1474. XXpwMDrawArcs        XDrawArcs          arcs,narcs
  1475. XXpwMDrawArc         XDrawArc          x,y,w,h,a1,a2
  1476. XXpwMDrawLine        XDrawLine         x,y,w,h
  1477. XXpwMDrawLines       XDrawLines          pts,npts
  1478. XXpwMDrawPoint       XDrawPoint        x,y
  1479. XXpwMDrawPoints      XDrawPoints          pts,npts
  1480. XXpwMDrawRectangle   XDrawRectangle    x,y,w,h
  1481. XXpwMDrawRectangles  XDrawRectangles   recs,nrecs
  1482. XXpwMDrawSegments    XDrawSegments     segs,nsegs
  1483. XXpwMFillArc         XFillArc          x,y,w,h,a1,a2
  1484. XXpwMFillArcs        XFillArcs          arcs,narcs
  1485. XXpwMFillPolygon     XFillPolygon      pts,npts,shape,mode
  1486. XXpwMFillRectangle   XFillRectangle    x,y,w,h
  1487. XXpwMFillRectangles  XFillRectangles   recs,nrecs
  1488. XXpwMDrawString      XDrawString       x,y,str,len
  1489. XXpwMDrawImageString XDrawImageString  x,y,str,len
  1490. XXpwMPutImage        XPutImage         image,sx,sy,ex,ey,w,h
  1491. XXpwMGetImage        XGetImage         x,y,w,h,msk,format
  1492. XXpwMClearArea       XClearArea        x,y,w,h
  1493. XXpwMClearWindow     XClearWindow      none
  1494. XXpwMDrawImage          -              x,y,w,h,data
  1495. XXpwMCopyFrom           -              src_widget,x,y,w,h,ex,ey
  1496. XXpwMCopyTo             -              dst_widget,x,y,w,h,ex,ey
  1497. X
  1498. XFor more details of the arguments used by each graphics primative, see Chapter 
  1499. X6 of the Xlib Programming Manual, vol. 1. Note that GC's, windows and
  1500. Xdisplays are supplied by the method, and need not be passed as arguments.
  1501. X
  1502. XDetails of XpwMDrawImage, XpwMCopyFrom and XpwMCopyTo are in REF *PopPixmap.
  1503. X
  1504. X
  1505. X-- PopGraphic Methods -------------------------------------------------
  1506. X
  1507. X========================================================================
  1508. XMethod Name         Arguments         Notes
  1509. X========================================================================
  1510. XXpwMCreateColormap  none              sets switchCmaps on.
  1511. XXpwMFreeColormap    none
  1512. XXpwMAllocColorRange n,r,g,b,r,g,b     see below.
  1513. XXpwMAllocStoreColor r,g,b
  1514. XXpwMSetPixelColor   p,r,g,b
  1515. X
  1516. X
  1517. XXpwMCreateColormap
  1518. X    XpwCallMethod(widget, XpwMCreateColormap)
  1519. X    Widget widget;
  1520. X
  1521. X    This method calls XCreateColormap to make a new colormap for the
  1522. X    widget. If the call is successful, a non-zero value is returned.
  1523. X
  1524. XXpwMFreeColormap
  1525. X    XpwCallMethod(widget, XpwMFreeColormap)
  1526. X    
  1527. X    This method frees the colormap of the widget, and sets the colormap to
  1528. X    the default colormap of the screen.
  1529. X
  1530. XXpwMAllocColorRange
  1531. X    XpwCallMethod(widget, XpwMAllocColorRange, num_cells, r1,g1,b1, r2,g2,b2);
  1532. X    Widget widget;
  1533. X    int num_cells, r1,g1,b1,r2,g2,b2;
  1534. X
  1535. X    This method allocates num_cells entries from the colormap and sets the
  1536. X    cells to the colors starting at one rgb value (r1,g1,b1) progressing
  1537. X    linearly to another rgb value (r2,g2,b2), which should be in the range
  1538. X    0-255. A simple gray scale can be created using:
  1539. X
  1540. X        XpwCallMethod(widget, XpwMAllocColorRange, 100, 0,0,0, 255,255,255);
  1541. X
  1542. XXpwMAllocStoreColor
  1543. X    XpwCallMethod(widget, XpwMAllocStoreColor, r,g,b)
  1544. X    Widget widget;
  1545. X    int r,g,b;
  1546. X
  1547. X    Uses XAllocColor and XStoreColor to allocate and store a color cell with
  1548. X    the specified rgb value.
  1549. X
  1550. XXpwMSetPixelColor
  1551. X    XpwCallMethod(widget, XpwMSetPixelColor, pixel, r,b,g);
  1552. X    Widget widget;
  1553. X    Pixel pixel;
  1554. X    int r,g,b;
  1555. X
  1556. X    Sets the read/write pixel to the specified color.
  1557. END_OF_FILE
  1558. if test 13333 -ne `wc -c <'doc/ref/PopGraphic'`; then
  1559.     echo shar: \"'doc/ref/PopGraphic'\" unpacked with wrong size!
  1560. fi
  1561. # end of 'doc/ref/PopGraphic'
  1562. fi
  1563. if test -f 'doc/ref/PopPixmap' -a "${1}" != "-c" ; then 
  1564.   echo shar: Will not clobber existing file \"'doc/ref/PopPixmap'\"
  1565. else
  1566. echo shar: Extracting \"'doc/ref/PopPixmap'\" \(11820 characters\)
  1567. sed "s/^X//" >'doc/ref/PopPixmap' <<'END_OF_FILE'
  1568. XREF *PopPixmap                                  Jonathan Meyer, Jan 1990
  1569. X
  1570. XPoplog Widget Set, revision 3.
  1571. X
  1572. XThis file describes the PopPixmap widget class, which is part of the
  1573. XPoplog Widget Set. For details of other widgets in the Poplog Widget
  1574. XSet, see HELP *PopWidgets. For information about the Pop-11 interface
  1575. Xto the PopPixmap widget see HELP *PopPixmap.
  1576. X
  1577. X-- PopPixmap Widget ---------------------------------------------------
  1578. X
  1579. XSuperclass: PopCore.
  1580. X
  1581. XMost widgets have a window associated with them. However, the PopPixmap
  1582. Xwidget is not in this sense a widget, as it does not have an associated
  1583. Xwindow. Instead it is a way of creating X Pixmaps using the facilities
  1584. X(eg. resources) of the X Toolkit. Pixmaps are the same as windows,
  1585. Xexcept that they are never visible to the user. Pixmaps are therefore used
  1586. Xto contain copies of windows, or to perform cut/paste operations between
  1587. Xwindows.
  1588. X
  1589. XThe PopPixmap widget is intended as the base for widgets that are graphical
  1590. Xin nature, and its functionality is an important part of the PopGraphic
  1591. XWidget. It contains resources such as lineWidth and function that are used
  1592. Xto set and retreive values from the 'usersGC' graphics context.
  1593. X
  1594. XX pixmaps are created at widget initialization time. Because class widget
  1595. XInitialize procedures are super-to-subclass chained, subclasses of
  1596. XPopPixmap widgets will have pixmaps created for them automatically.
  1597. X
  1598. XThe PopPixmap widget has a resource which is used to control the pixmap.
  1599. XThis allows subclasses and applications to use the methods and resources 
  1600. Xof PopPixmap widgets without also using the pixmap.
  1601. X
  1602. XThe PopPixmap realize procedure assigns the pixmap created at
  1603. Xinitialize to the window slot of the widget structure.
  1604. X
  1605. XResizing a PopPixmap widget causes the creation of a new pixmap
  1606. X(XCreatePixmap) of the specified size. The old pixmaps
  1607. Xcontents is then copied to the new pixmap (XCopyArea), and the old
  1608. Xpixmap is released (XFreePixmap). This is expensive, but Xlib does not
  1609. Xhave an XResizePixmap request. To minimize this, the pixmap is only
  1610. Xresized when the widget has grown in size.
  1611. X
  1612. XDestroying a PopPixmap widget causes its pixmap and graphics context
  1613. Xresources to be freed.
  1614. X
  1615. XThe class variable of PopPixmap is popPixmapWidgetClass.
  1616. X
  1617. X-- PopPixmap Resources ------------------------------------------------
  1618. X
  1619. XPopPixmap inherits all of the resources of PopCore. The following
  1620. Xresources are retrieved from the argument list or the resource database
  1621. Xwhen PopPixmap widgets are created.
  1622. X
  1623. XCore and PopCore resources
  1624. X
  1625. X===============================================================================
  1626. XName            Class        RepType    Default*   Description
  1627. X===============================================================================
  1628. XXtNwidth        Width        Dimension  200        Window width
  1629. XXtNheight       Height       Dimension  100        Window height
  1630. XXtNx            X            Position   0          X coordinate in pixels
  1631. XXtNy            Y            Position   0          Y coordinate in pixels
  1632. XXtNborderWidth  BorderWidth  Dimension  1          Border width in pixels
  1633. XXtNborderPixmap BorderPixmap Pixmap     None       Window border pixmap
  1634. XXtNborderColor  BorderColor  Pixel      foreground Window border color
  1635. XXtNbackground   Background   Pixel      XtDefault  Window background color
  1636. XXtNforeground   Foreground   Pixel      XtDefault  Window foreground color
  1637. XXtNfont         Font         FontStruct XtDefault  Font for text operations
  1638. XXtNpointerShape Cursor       Cursor     None       mouse cursor(cursorfont)
  1639. XXtNtranslations Translations String     see below  Event-to-action translations
  1640. XXtNpopCallback  Callback     Pointer    NULL       Callbacks for events
  1641. XXtNautoFlush    Boolean      Boolean    TRUE       XFlush after methods?
  1642. XXtNusersGC      GC           Pointer    NULL       Graphics Context for ops
  1643. XXtNmodifiers    Parameter    Int        None       event->state modifiers
  1644. XXtNdestroyCallback           Callback   NULL       XtDestroyWidget callback
  1645. XXtNmappedWhenManaged         Boolean    TRUE       automatic XtMapWidget
  1646. X
  1647. XPopPixmap resources
  1648. X
  1649. X=======================================================================
  1650. XName             Class         RepType  Default*   Description
  1651. X=======================================================================
  1652. XXtNfunction      Function      Int      XtDefault  GC drawing mode
  1653. XXtNsubwindowMode SubWindowMode Int      XtDefault  GC subwindow mode
  1654. XXtNlineWidth     LineWidth     Int      XtDefault  GC line width
  1655. XXtNlineStyle     LineStyle     Int      XtDefault  GC line style
  1656. XXtNcapStyle      CapStyle      Int      XtDefault  GC cap style
  1657. XXtNjoinStyle     JoinStyle     Int      XtDefault  GC join style
  1658. XXtNprivateGC     GC            Pointer  None       Pixmap Graphics Context 
  1659. XXtNpixmap        Pixmap        Pointer  None       Pixmap of Widget.
  1660. XXtNpixmapStatus  PixmapStatus  Cardinal PixmapOn   Is Pixmap active?
  1661. X
  1662. X* default values listed as XtDefault are in fact set to the string
  1663. X  XtDefault<Class> where Class is the class name of that resource, eg.
  1664. X  'XtDefaultLineWidth', 'XtDefaultLineStyle' etc.
  1665. X
  1666. X
  1667. X-- Resource Notes -------------------------------------------------------------
  1668. X
  1669. XThe following notes describe new resources or properties of resources for
  1670. XPopPixmap widgets.
  1671. X
  1672. X
  1673. XXtNfunction XtNsubwindowMode XtNlineWidth 
  1674. XXtNlineStyle XtNcapStyle XtNjoinStyle
  1675. X    The first 6 PopPixmap resources are slots in the 'usersGC' Graphics Context.
  1676. X    Changing the 'function' resource of a PopPixmap widget is in fact the same
  1677. X    as calling XChangeGC to modify the function slot of the usersGC. String
  1678. X    converters are provided, so that valid values for each of these resources
  1679. X    can be specified in a resource file that is read by xrdb(1). For more on
  1680. X    Graphics Contexts, see the Xlib Programming Manual, vol 1, Chapter 5.
  1681. X
  1682. XXtNpixmap
  1683. X    The 'pixmap' resource can be modified. Changing this resource causes an
  1684. X    XFreePixmap call to release the previous pixmap. A valid Pixmap must be
  1685. X    used if this resource is updated. This may have strange side effects,
  1686. X    since the width and height of the widget will become out of sync with the
  1687. X    width and height of the pixmap.
  1688. X
  1689. XXtNpixmapStatus
  1690. X    A PopPixmap widget's pixmap can be in one of three states: PixmapOn
  1691. X    is the default normal state, PixmapOff indicates that the widget
  1692. X    has a valid pixmap, but any methods applied to the widget will have
  1693. X    no effect to the pixmap, and PixmapHasNone indicates that the widget does
  1694. X    not have a valid pixmap. Changing from PixmapHasNone to PixmapOn causes
  1695. X    an XCreatePixmap request. Changing from PixmapOn to PixmapHasNone frees the
  1696. X    current Pixmap.  Changing to PixmapOn also causes the widgets redisplay
  1697. X    procedure to be called.
  1698. X
  1699. XXtNprivateGC
  1700. X    The 'privateGC' resource should not be modified. It is a server default
  1701. X    graphics context, and is used by subclasses of PopPixmap to copy pixmaps
  1702. X    to windows. Applications may fetch this resource if they wish to use
  1703. X    a default graphics context for some operation.
  1704. X
  1705. XActions and Translations
  1706. X
  1707. XPopPixmap widgets do not have any actions, or translation tables. Events
  1708. Xcannot occur on pixmaps, so the notion of events is not useful.
  1709. X
  1710. XMethods
  1711. X
  1712. XPopPixmap widgets respond to all of the Xpw equivelants of the Xlib 
  1713. Xgraphics operations:
  1714. X
  1715. X========================================================================
  1716. XMethod Name         Xlib Procedure    Arguments
  1717. X========================================================================
  1718. XXpwMDrawArc         XDrawArc          x,y,w,h,a1,a2
  1719. XXpwMDrawArcs        XDrawArcs          arcs,narcs
  1720. XXpwMDrawLine        XDrawLine         x,y,w,h
  1721. XXpwMDrawLines       XDrawLines          pts,npts
  1722. XXpwMDrawPoint       XDrawPoint        x,y
  1723. XXpwMDrawPoints      XDrawPoints          pts,npts
  1724. XXpwMDrawRectangle   XDrawRectangle    x,y,w,h
  1725. XXpwMDrawRectangles  XDrawRectangles   recs,nrecs
  1726. XXpwMDrawSegments    XDrawSegments     segs,nsegs
  1727. XXpwMFillArc         XFillArc          x,y,w,h,a1,a2
  1728. XXpwMFillArcs        XFillArcs          arcs,narcs
  1729. XXpwMFillPolygon     XFillPolygon      pts,npts,shape,mode
  1730. XXpwMFillRectangle   XFillRectangle    x,y,w,h
  1731. XXpwMFillRectangles  XFillRectangles   recs,nrecs
  1732. XXpwMDrawString      XDrawString       x,y,str,len
  1733. XXpwMDrawImageString XDrawImageString  x,y,str,len
  1734. XXpwMPutImage        XPutImage         image,sx,sy,ex,ey,w,h
  1735. XXpwMGetImage        XGetImage         x,y,w,h,msk,format
  1736. XXpwMDrawImage          -              w,h,x,y,data,depth
  1737. XXpwMClearArea       XClearArea        x,y,w,h
  1738. XXpwMClearWindow        -              none
  1739. XXpwMCopyFrom           -              src_widget,x,y,w,h,ex,ey
  1740. XXpwMCopyTo             -              dst_widget,x,y,w,h,ex,ey
  1741. X
  1742. XAll except the last four of the PopPixmap methods are identical to their Xlib 
  1743. Xcounterparts, except that they take a widget instead of a window. They all
  1744. Xuse the widget's display, usersGC and pixmap, as required, in calls to
  1745. Xtheir related Xlib functions.  For example, to draw a line on a PopPixmap 
  1746. Xwidget p, use:
  1747. X
  1748. X    XpwCallMethod(p, XpwMDrawLine, 1,1,100,100);
  1749. X
  1750. XFor more details of the arguments used by each graphics primative, see Chapter 
  1751. X6 of the Xlib Programming Manual, vol. 1.
  1752. X
  1753. X
  1754. XDetails of XpwMDrawImage, XpwMCopyFrom and XpwMCopyTo are given below:
  1755. X
  1756. XXpwMCopyFrom
  1757. X    XpwCallMethod(wid, XpwMCopyFrom, src_wid,x,y,w,h,ex,ey);
  1758. X    Widget wid, src_wid;
  1759. X    int x,y,w,h,ex,ey;
  1760. X
  1761. X    This method parallel's the Xlib XCopyArea function. The method takes
  1762. X    a source widget src_wid, and copies the area within the rectangle (x,y,w,h)
  1763. X    from the source widget to (ex,ey) in the pixmap widget wid. If w or h
  1764. X    are zero, the width and height of the src_wid are used. If
  1765. X    src_wid is NULL, then wid is used as both the source and the
  1766. X    destination of the XCopyArea function. wid must be a PopPixmap widget, 
  1767. X    or a subclass of a PopPixmap widget.
  1768. X
  1769. XXpwMCopyTo
  1770. X    XpwCallMethod(wid, XpwMCopyTo, dest_wid, x,y,w,h,ex,ey);
  1771. X    Widget wid, dest_wid;
  1772. X    int x,y,w,h,ex,ey;
  1773. X
  1774. X    This method parallel's the Xlib XCopyArea function, and is similar to
  1775. X    the XpwMCopyFrom method. The method takes a destination widget dest_wid,
  1776. X    and copies the area specified by the rectangle (x,y,w,h) of the pixmap
  1777. X    of wid to ex,ey of the window of dest_wid.  If w or h
  1778. X    are zero, the width and height of the widget wid are used. If
  1779. X    dest_wid is NULL, then wid is used as both the source and the
  1780. X    destination of the XCopyArea function. wid must be a PopPixmap widget,
  1781. X    or a subclass of a PopPixmap widget. 
  1782. X
  1783. XXpwMDrawImage
  1784. X    XpwCallMethod(widget, XpwMDrawImage,w,h,x,y,data,depth)
  1785. X    Widget widget;
  1786. X    int x,y,w,h,depth;
  1787. X    char *data;
  1788. X
  1789. X    This method takes a pointer to some data, and a size width/height (w/h) of
  1790. X    the image that is held in the data. It uses XCreateImage to construct
  1791. X    an image of the specified size, using the specified data, which is
  1792. X    expected to be in the right format for the visual class of the screen
  1793. X    of the widget (ie. ZPixmap for color and XYPixmap for mono screens).
  1794. X    This image is then copied to the pixmap of the PopPixmap widget at x,y,
  1795. X    using XPutImage. Finally, the XImage structure is released using
  1796. X    XDestroyImage.
  1797. X
  1798. X
  1799. XResource Converters
  1800. X
  1801. XNew resource converters are registered to convert between the graphics
  1802. Xcontext fieldname strings, and their values, and for XtNpixmapStatus resources.
  1803. XFor example, a possible resource table entry for the XtNfunction resource is:
  1804. X
  1805. X    Draw*function:    xor
  1806. X
  1807. XPossible values for each resource (with the default given last) are:
  1808. X
  1809. Xfunction:
  1810. X
  1811. X    clear and andReverse andInverted noop xor or nor equiv invert
  1812. X    orReverse set copyInverted orInverted nand copy 
  1813. X
  1814. XsubwindowMode:
  1815. X
  1816. X    IncludeInferiors ClipByChildren
  1817. X
  1818. XcapStlye:
  1819. X
  1820. X    NorLast Round Projecting Butt
  1821. X
  1822. XjoinStyle:
  1823. X
  1824. X    Bevel Round Miter
  1825. X
  1826. XlineStyle:
  1827. X
  1828. X    OnOffDash DoubleDash Solid
  1829. X
  1830. XpixmapStatus:
  1831. X   
  1832. X    PixmapOn PixmapOff PixmapHasNone
  1833. END_OF_FILE
  1834. if test 11820 -ne `wc -c <'doc/ref/PopPixmap'`; then
  1835.     echo shar: \"'doc/ref/PopPixmap'\" unpacked with wrong size!
  1836. fi
  1837. # end of 'doc/ref/PopPixmap'
  1838. fi
  1839. echo shar: End of archive 1 \(of 2\).
  1840. cp /dev/null ark1isdone
  1841. MISSING=""
  1842. for I in 1 2 ; do
  1843.     if test ! -f ark${I}isdone ; then
  1844.     MISSING="${MISSING} ${I}"
  1845.     fi
  1846. done
  1847. if test "${MISSING}" = "" ; then
  1848.     echo You have unpacked both archives.
  1849.     rm -f ark[1-9]isdone
  1850. else
  1851.     echo You still need to unpack the following archives:
  1852.     echo "        " ${MISSING}
  1853. fi
  1854. ##  End of shell archive.
  1855. exit 0
  1856.  
  1857. dan
  1858. -----------------------------------------------------------
  1859.             O'Reilly && Associates
  1860.         argv@sun.com / argv@ora.com
  1861.        632 Petaluma Ave, Sebastopol, CA 95472 
  1862.      800-338-NUTS, in CA: 800-533-NUTS, FAX 707-829-0104
  1863.     Opinions expressed reflect those of the author only.
  1864.